# $Id: PKGBUILD 87852 2013-04-08 09:24:14Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: Angel 'angvp' Velasquez <angvp[at]archlinux.com.ve>
# Maintainer: Douglas Soares de Andrade <dsa@aur.archlinux.org>

pkgbase=python-psycopg2
pkgname=('python-psycopg2' 'python2-psycopg2')
pkgver=2.5
pkgrel=1
pkgdesc="A PostgreSQL database adapter for the Python programming language."
arch=('i686' 'x86_64')
url="http://initd.org/psycopg/"
license=('LGPL3')
makedepends=('python2' 'python' 'postgresql-libs>=8.4.1')
source=(http://initd.org/psycopg/tarballs/PSYCOPG-2-5/psycopg2-$pkgver.tar.gz)
md5sums=('facd82faa067e99b80146a0ee2f842f6')

build() {
  cd "$srcdir/psycopg2-$pkgver"
  sed -i 's/,PSYCOPG_DEBUG$//' setup.cfg
}

package_python-psycopg2() {
  depends=('python' 'postgresql-libs>=8.4.1')

  cd "$srcdir/psycopg2-$pkgver"
  python setup.py install --root="$pkgdir"
}

package_python2-psycopg2() {
  depends=('python2' 'postgresql-libs>=8.4.1')

  cd "$srcdir/psycopg2-$pkgver"
  python2 setup.py install --root="$pkgdir"
}
